#ifndef __RED_INT_OBJECT_H__
#define __RED_INT_OBJECT_H__

#include <stdint.h>
#include "redobject.h"

typedef struct _RedIntObject
{
	RedObject_HEAD

	int64_t in_value;
} RedIntObject;

RED_EXPORT extern RedTypeObject RedType_Int;

#define RedInt_Exact(o)		((o)->ob_type == &RedType_Int)
#define RedInt_Value(o)		(((RedIntObject *)(o))->in_value)

RED_EXPORT void Red_FreeIntegerPool(void);
RED_EXPORT char Red_InitIntegerPool(void);

RED_EXPORT RedObject *RedInt_FromInt(int64_t value);
RED_EXPORT RedObject *RedInt_FromFloat(float value);

RED_EXPORT RedObject *RedInt_FromBool(RedObject *value);
RED_EXPORT RedObject *RedInt_FromString(RedObject *value, int base);
RED_EXPORT RedObject *RedInt_FromCString(const char *value, int base);

#endif /* __RED_INT_OBJECT_H__ */
